/**
 * Created by baidm in 2022/4/10 on 17:12
 */
type PlugsType = (x: number, y: number) => number
let sum: PlugsType = (x, y) => x + y

type StrOrNumber = string | number
let res: StrOrNumber = "str"

type Direction = "up" | "down" | "left" | "right"   // 联合类型
let where: Direction = "up"

interface IName {
  name: string
}

type IPerson = IName & { age: number }  // 交叉类型
let person: IPerson = {name: "str", age: 12}